local serviceId

function OnInit(id)
    print("[lua] ping OnInit")
    serviceId = id 
end 

-- lua-serialize 编码解码
-- 屏蔽send的第一个参数
function OnServiceMsg(toSrv, msg)
    -- local a, b = 0, 0

    -- -- 解码
    -- if msg ~= "start" then 
    --     a, b = string.unpack("i4 i4", msg)
    -- end 

    -- print("[lua] ping OnServiceMsg a : " .. a .. " b : " .. b)
    -- a, b = b, a + b
    -- --编码
    -- sunnet.Send(serviceId, toSrv, string.pack("i4 i4", a, b))
end 

function OnSocketData(fd, msg) 
    
end

function OnExit() 
    print("[lua] ping OnExit")
end 